/*
 * Socket.h
 *
 */

#ifndef SOCKET_H_
#define SOCKET_H_

#include	<stdio.h>
#include   <stdlib.h>
#include   <unistd.h>
#include	<signal.h>
#include	<sys/wait.h>
#include   <sys/resource.h>
#include 	<string.h>
#include	<sys/types.h>
#include	<sys/socket.h>
#include	<netinet/in.h>
#include	<arpa/inet.h>
#include	<netdb.h>
#include "../common/Exception.h"

#define	 SERV_UDP_PORT	5000
#define	 PORT_FIJO	 5000		//port por defecto


namespace ipc {

class Socket {
public:
	Socket();
	explicit Socket(int fd);
	virtual ~Socket();

	int getFd();

	void send(void *datos, size_t nbytes);
	void receive(void *datos, size_t nbytes);

	void close();

protected:
	int m_Fd;
};

} /* namespace IPC */
#endif /* SOCKET_H_ */
